﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DataLayer;

public partial class Widgets_Generic_Clock_template : System.Web.UI.Page
{
   public int ClockID = 1;
   protected void Page_Load(object sender, EventArgs e)
   {
      int ID = -1;
      try
      {
         ID = Convert.ToInt32(Request.QueryString["id"]);
      }
      catch
      {
         ID = -1;
      }

      if (ID > 0)
      {
         try
         {
            using (var db = DatabaseHelper.GetDashboardData())
            {
               var WS = (from p in db.TabWidgets
                         where p.Id == ID
                         select p).Single();

               ClockID = Typecast.ToInt32(WS.State);
               if (ClockID < 1)
                  ClockID = 1;
            }
         }
         catch
         {
         }
      }
   }
}